<template>
  <el-table :data="data" style="margin-top: 10px" height="290" border v-loading="loading">
    <el-table-column label="序号" type="index" width="60" align=center />
    <el-table-column label="业务员" prop="StatisticName"></el-table-column>
    <el-table-column label="樘数">
      <template v-slot="scope">
        {{ scope.row.Count.split("(")[0] }}
      </template>
    </el-table-column>
    <el-table-column label="业绩(元)">
      <template #header>
        业绩(元)
        <el-button v-if="more" type="primary" link @click="emits('openMore')"
          >更多
          <el-icon class="el-icon--right"><ArrowRight /></el-icon>
        </el-button>
      </template>
      <template v-slot="scope">
        {{ scope.row.Count.split("(")[1].slice(0, -1) }}
      </template>
    </el-table-column>
  </el-table>
</template>
<script setup>
import { ArrowRight } from '@element-plus/icons-vue';

const emits = defineEmits(["openMore"]);
const props = defineProps({
  data: {
    type: Object,
    default: () => [],
  },
  more: {
    type: Boolean,
    default: () => false,  
  },
  loading: {
    type: Boolean,
    default: () => false,  
  }
});
function handleSort(a, b) {
  return a.Count.split("(")[0] - b.Count.split("(")[0];
}

</script>
